//
//  GHMyCollectTableViewCell.m
//  GreenHome
//
//  Created by Mac on 2018/10/11.
//  Copyright © 2018年 stoneobs.qq.com. All rights reserved.
//

#import "OEOrderTableViewCell.h"

@interface  OEOrderTableViewCell()
@property(nonatomic, strong) UIImageView                     *bannerImageView;/**<  */
@property(nonatomic, strong) STLabel                     *titleLable;/**<  */
@property(nonatomic, strong) STLabel                     *sizeLable;/**<  */
@property(nonatomic, strong) STLabel                     *moneyLable;/**<  */
@property(nonatomic, strong) STLabel                     *stockLable;/**<  */

@property(nonatomic, strong) UIView                     *grawView;/**< 售罄 */

@end
@implementation OEOrderTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 100;
}
#pragma mark --subView
- (void)configSubView{
    self.backgroundColor = UIColor.whiteColor;
    
    
    UIView * whiteView = [[UIView alloc] initWithFrame:CGRectMake(15, 0, UIScreenWidth - 30, 100)];
    whiteView.backgroundColor = UIColor.whiteColor;
    [self addSubview:whiteView];
    
    
    self.bannerImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 80, 80)];
    self.bannerImageView.image = [TMRandImageTool bundleImageWithImageName:TMRandImageTool.randOneGoodBanner];
    [whiteView addSubview:self.bannerImageView];
    
    
    
    STLabel * titleLable = [[STLabel alloc] initWithFrame:CGRectMake(self.bannerImageView.right+10, 10, whiteView.width - 20 -self.bannerImageView.right , 40)
                                                     text:@"花生有农家自榨现在非转基金"
                                                textColor:FirstTextColor
                                                     font:15
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    self.titleLable = titleLable;
    [whiteView addSubview:titleLable];
    
    
    STLabel * nromalLable = [[STLabel alloc] initWithFrame:CGRectMake(self.bannerImageView.right+10, 10, UIScreenWidth - 20 -self.bannerImageView.right , 20)
                                                      text:@"默认贵哦:2斤"
                                                 textColor:SecendTextColor
                                                      font:13
                                               isSizetoFit:NO
                                             textAlignment:NSTextAlignmentLeft];
    self.sizeLable = nromalLable;
    self.sizeLable.bottom = self.bannerImageView.bottom;
    [whiteView addSubview:nromalLable];
    
    
    STLabel * moneyLable = [[STLabel alloc] initWithFrame:CGRectMake(self.bannerImageView.right+10, 10, UIScreenWidth - 20 -self.bannerImageView.right , 20)
                                                     text:@"默认贵哦:2斤"
                                                textColor:FlatRed
                                                     font:13
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentRight];
    self.moneyLable = moneyLable;
    self.moneyLable.right = whiteView.width - 10;
    self.moneyLable.bottom = self.bannerImageView.bottom;
    [whiteView addSubview:moneyLable];
    
    
    
}
- (void)setModel:(OEGoodModel *)model{
    _model = model;
    [self.bannerImageView sd_setImageWithURL:[NSURL URLWithString:model.goods_img]];
    self.titleLable.text = model.goods_name;
    self.sizeLable.text = [NSString stringWithFormat:@"x%@",model.goods_number];
    self.moneyLable.text = model.goods_price;
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
}
@end


